import os

value_path = 'code/value'


def scan_value_package() -> list[str]:
    """
    扫描value全家桶包
    """
    return [file_name for file_name in os.listdir(value_path) if file_name.endswith('.go')]


def open_go_file(file_name: str) -> str:
    """
    打开go文件
    :param file_name: 文件名称
    :return: 文件内容
    """
    with open(os.path.join(value_path, file_name), 'r', encoding='utf-8') as f:
        return f.read()


def family_bucket_config_item(
        config_item: list[list]
):
    """
    传入配置项JSON二维数组，确认是否可复用全家桶配置项
    """
    value_go_path_list = scan_value_package()
    for path in value_go_path_list:
        go_code = open_go_file(path)
        print(go_code)


if __name__ == '__main__':
    family_bucket_config_item([])
